package 代码记录.校招笔试真题.笔试真题_2022.奇安信;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author zx
 * @create 2022-08-25 22:45
 */
public class 盛最多水的容器_11 {
    /**
     * 查找直角坐标系内的两个点使他们与X轴围成的长方形面积最大
     *
     * 自己当时暴力过了100%; 但是在leetcode会超时
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        System.out.println(line);
        List<Character> list = new ArrayList<>();
        for(int i = 0;i < line.length();i++){
            if(line.charAt(i) >= '0' && line.charAt(i) <= '9'){
                list.add(line.charAt(i));
            }
        }
        int[][] arr = new int[list.size()][2];
        int count = 0;
        for(Character i : list){
            arr[count][0] = count;
            arr[count][1] = i - '0';
            count++;
        }
        int res = 0;
        for(int i = 0;i < arr.length;i++){
            int a = arr[i][0];
            int b = arr[i][1];
            for(int j = arr.length - 1;j >= 0;j--){
                int x = arr[j][0];
                int y = arr[j][1];
                int l = Math.abs(x - a);
                int h = Math.min(b,y);
                res = Math.max(res,(l * h));
            }
        }
        System.out.println(res);
    }
}
